package com.example.demo.service.impl;

import com.example.demo.domain.SystemConfig;
import com.example.demo.enums.StatusEnum;
import com.example.demo.repository.SystemConfigRepository;
import com.example.demo.service.SystemConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Author zhengmf
 * @Date 2018/12/27  18:28
 */
@Service
@Transactional
public class SystemConfigServiceImpl implements SystemConfigService {
    @Autowired
    private SystemConfigRepository systemConfigRepository;

    @Override
    public void saveSysConfig(SystemConfig systemConfig) {
 //       systemConfig.setStatus(StatusEnum.E.name());
        systemConfigRepository.save(systemConfig);
    }

    @Override
    public void updateStatus(Long id) {
        systemConfigRepository.updateStatus(StatusEnum.D.name(),id);
    }

}
